<template>
	<view class="content">
		<!-- 顶部导航 -->
		<view class="header">
			<!-- 适配导航栏 -->
			<view class="status"></view>
			<!-- 电影类型组件 -->
			<view class="header-nav">
				<image src="../../static/vip.png" mode=""></image>
				<view class="nav-item item-selected"  >热门</view>
				<view class="nav-item"  @tap="goMovie()">电影</view>
				<view class="nav-item"  >电视剧</view>
				<view class="nav-item"  >动漫</view>
			</view>
			<!-- 搜索栏 -->
			<view class="header-search">
				<view class="search-box">
					<view class="box-input">
					</view>
					<view class="box-line">
						|
					</view>
					<text class="box-icon cuIcon-search"></text>
				</view>
				<text class="serach-icon text-white cuIcon-countdownfill"></text>
			</view>
			
		</view>
		<!-- 排行榜 -->
		<view class="title-box">
			<view class="box-name">
				<text class="box-icon cuIcon-rankfill"></text>
				<view class="title">
					热搜排行榜
				</view>
			</view>
			<text class="box-right cuIcon-right"></text>
		</view>
		<!-- 内容主体 -->
		<view class="main">
			<view class="movie-box" v-for="(item, index) in RankList" :key="index" @tap="goDetail(item.title, item.img, item.href)">
				<image :src="item.img" mode=""></image>
				<view class="movie-name">
					{{item.title}}
				</view>
			</view>
			
		</view>
		<!-- 正在热映 -->
		<view class="title-box">
			<view class="box-name">
				<text class="box-icon cuIcon-hotfill"></text>
				<view class="title">
					正在热映
				</view>
			</view>
			<text class="box-right cuIcon-right"></text>
		</view>
		<!-- 内容主体 -->
		<view class="main">
			<view class="movie-box" v-for="(item, index) in HotList" :key="index" @tap="goDetail(item.title, item.img, item.href)">
				<image :src="item.img" mode=""></image>
				<view class="movie-name">
					{{item.title}}
				</view>
			</view>
			
		</view>
		<!-- 网络电影 -->
		<view class="title-box">
			<view class="box-name">
				<text class="box-icon cuIcon-lightfill"></text>
				<view class="title">
					网络电影
				</view>
			</view>
			<text class="box-right cuIcon-right"></text>
		</view>
		<!-- 内容主体 -->
		<view class="main">
			<view class="movie-box" v-for="(item, index) in NatList" :key="index" @tap="goDetail(item.title, item.img, item.href)">
				<image :src="item.img" mode=""></image>
				<view class="movie-name">
					{{item.title}}
				</view>
			</view>
		</view>
		
		<!-- last -->
		<view class="last">
			没有更多啦&nbsp;~
		</view>
		
	</view>
</template>

<script>
	import $ from '../../static/jquery.js';
	export default {
		data() {
			return {
				RankList: [{
						'title': '奇门遁甲',
						'img': 'https://pic5.iqiyipic.com/image/20200323/44/7a/v_145276397_m_601_m14_480_270.jpg',
						'href': 'http://www.iqiyi.com/v_19rxcyu9nw.html'
					},{
						'title': '天·火',
						'img': 'https://pic1.iqiyipic.com/image/20200321/fd/ca/v_127975290_m_601_m19_180_236.jpg',
						'href': 'http://www.iqiyi.com/v_19rsjow0wg.html'
					},{
						'title': '干将莫邪',
						'img': 'https://pic3.iqiyipic.com/image/20200320/d5/bc/v_146186136_m_601_m6_180_236.jpg',
						'href': 'http://www.iqiyi.com/v_19rwy4z5lg.html'
					},{
						'title': '封神榜·妖灭',
						'img': 'https://pic8.iqiyipic.com/image/20200310/4a/cb/v_145492686_m_601_m2_180_236.jpg',
						'href': 'http://www.iqiyi.com/v_19rxhnrkd4.html'
					},{
						'title': '狙击手',
						'img': 'https://pic4.iqiyipic.com/image/20200311/66/03/v_144504652_m_601_m10_180_236.jpg',
						'href': 'http://www.iqiyi.com/v_19rvwniql4.html'
					},{
						'title': '叶问4：完结篇',
						'img': 'https://pic8.iqiyipic.com/image/20200209/85/61/v_115505617_m_601_m25_180_236.jpg',
						'href': 'http://www.iqiyi.com/v_19rrc1di2c.html'
					},
					
				],
				HotList: [{
						'title': '天·火',
						'img': 'https://pic1.iqiyipic.com/image/20200321/fd/ca/v_127975290_m_601_m19_180_236.jpg',
						'href': 'http://www.iqiyi.com/v_19rsjow0wg.html'
					},{
						'title': '钢铁侠（普通话）',
						'img': 'https://pic4.iqiyipic.com/image/20200319/ee/80/v_133781343_m_601_m2_180_236.jpg',
						'href': 'http://www.iqiyi.com/v_19rrzk2cz8.html'
					},{
						'title': '希望（2018）',
						'img': 'https://pic7.iqiyipic.com/image/20200320/b9/f2/v_138567071_m_601_m2_180_236.jpg',
						'href': 'http://www.iqiyi.com/v_19ru3rtb78.html'
					},{
						'title': '遗忘尼克',
						'img': 'https://pic6.iqiyipic.com/image/20200320/3c/29/v_140695978_m_601_m2_180_236.jpg',
						'href': 'http://www.iqiyi.com/v_19rv7n7sw8.html'
					},{
						'title': '哈利·波特7：哈利·波特与死亡圣器(上)（普通话）',
						'img': 'https://pic1.iqiyipic.com/image/20200318/5c/53/v_145804680_m_601_m2_180_236.jpg',
						'href': 'http://www.iqiyi.com/v_19rx5iltm8.html'
					},{
						'title': '诸神之战（普通话）',
						'img': 'https://pic0.iqiyipic.com/image/20200318/41/d7/v_144001801_m_601_m1_180_236.jpg',
						'href': 'http://www.iqiyi.com/v_19rw5klzs0.html'
					},
				],
				NatList: [{
						'title': '永恒的心',
						'img': 'https://pic1.iqiyipic.com/image/20200323/f2/9f/v_145765297_m_601_m2_260_360.jpg',
						'href': 'https://www.iqiyi.com/v_19rx48w7yo.html'
					},{
						'title': '干将莫邪',
						'img': 'https://pic3.iqiyipic.com/image/20200320/d5/bc/v_146186136_m_601_m6_260_360.jpg',
						'href': 'https://www.iqiyi.com/v_19rwy4z5lg.html'
					},{
						'title': '燕赤霞生肖神将',
						'img': 'https://pic2.iqiyipic.com/image/20200320/c8/31/v_145535756_m_601_m5_260_360.jpg',
						'href': 'https://www.iqiyi.com/v_19rxi0tls0.html'
					},{
						'title': '奇门遁甲',
						'img': 'https://pic5.iqiyipic.com/image/20200323/44/7a/v_145276397_m_601_m14_260_360.jpg',
						'href': 'https://www.iqiyi.com/v_19rxcyu9nw.html'
					},{
						'title': '风云传之双剑合璧',
						'img': 'https://pic0.iqiyipic.com/image/20200318/17/94/v_145532830_m_601_m2_260_360.jpg',
						'href': 'https://www.iqiyi.com/v_19rxict8ag.html'
					},{
						'title': '剑王朝之九境长生',
						'img': 'https://pic8.iqiyipic.com/image/20200317/9e/e3/v_145894725_m_601_m5_260_360.jpg',
						'href': 'https://www.iqiyi.com/v_19rxbr5chc.html'
					},	
				],
				CartonList:[{
						'title': '',
						'img': '',
						'href': ''
					},
				],
			}
		},
		onLoad() {
		},
		methods: {
			getRankInfo(){ 
				uni.request({
					url: 'https://www.iqiyi.com/dianying_new/i_list_paihangbang.html',
					success: (res) => {
						$(res.data).find(li).map((index, data)=>{
							//console.log(data)
							var movie = {
								'title': $(data).attr('title'),
								'href': 'https:' + $(data).attr('href'),
								'img': 'https:' + $(data).child().attr('src')
							}
							list.push(movie);
						})

					}
				})
			},
			goMovie(){
				uni.navigateTo({
					url: '../movie/movie'
				})
			},
			goDetail(title, img, href){
				uni.navigateTo({
					url: '../detail/detail?title='+title+'&img='+img+'&href=' + href
				})
			}

		}
	}
</script>

<style>
	@import url("./index.css");
</style>
